package com.sscl.baselibrary.widget

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.DragEvent
import android.view.MotionEvent
import androidx.recyclerview.widget.RecyclerView

/**
 * 重写 RecyclerView,处理事件分发拦截。防止出现不能快速滚动的问题
 *
 * @author jackie
 */
class RecyclerViewWithOutScroll @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : RecyclerView(context, attrs, defStyleAttr) {

    @SuppressLint("ClickableViewAccessibility")
    override fun onTouchEvent(e: MotionEvent): Boolean {
        super.onTouchEvent(e)
        return false
    }

    override fun dispatchDragEvent(event: DragEvent): Boolean {
        super.dispatchDragEvent(event)
        return false
    }

    override fun onInterceptTouchEvent(e: MotionEvent): Boolean {
        super.onInterceptTouchEvent(e)
        return false
    }
}
